package cn.com.surker.gps.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 工程坐标
 * @author luotao
 * @date 2022/10/19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ProjectCoordinate implements Serializable {

	/**
	 * 站点名称
	 */
	private String orgName;

	/**
	 * 项目id
	 */
	private Long projectId;

	/**
	 * 项目名称
	 */
	private String projectName;

	/**
	 * 建设单位
	 */
	private String developmentUnits;

	public void setDevelopmentUnits(String developmentUnits) {
		if(StringUtils.hasText(developmentUnits)){
			this.developmentUnits = developmentUnits;
		}else {
			this.developmentUnits = "";
		}

	}

	/**
	 * 项目地址
	 */
	private String address;

	public void setAddress(String address) {
		if(StringUtils.hasText(address)){
			this.address = address;
		}else {
			this.address = "";
		}
	}

	/**
	 * 经度
	 */
	private String lng;

	public void setLng(String lng) {
		this.lng = lng;
		this.lnglat[0] = lng;
	}

	/**
	 * 纬度
	 */
	private String lat;

	public void setLat(String lat) {
		this.lat = lat;
		this.lnglat[1] = lat;
	}

	private String[] lnglat = {"",""};

	/**
	 * 签订方量
	 */
	private String totalStere;

	/**
	 * 已供方量
	 */
	private String signStere;

	/**
	 * 正供方量
	 */
	private Double provideStere;

	/**
	 * 用于前端地图点显示的样式索引
	 */
	private String style;

	public Integer getStyle() {
		if(provideStere == null || provideStere == 0){
			// 没有计划方量
			return 0;
		}else {
			return 1;
		}
	}

	/**
	 * 运输车辆
	 */
	private List<Object> cars;

}
